# -*- encoding: utf-8 -*-


from Tkinter import *
import Tix



class doobMini:
    def __init__(self, appRoot):

        self.toolBar = Frame(appRoot, borderwidth=1, relief=RAISED )
        self.leftFrame = Frame(appRoot, borderwidth=1, relief=RAISED)
        self.centerFrame = Frame(appRoot, borderwidth=1, relief=RAISED )
        self.rightFrame = Frame(appRoot, borderwidth=1, relief=RAISED )
        self.statusBar = Frame(appRoot, borderwidth=1, relief=RAISED )

        self.centerTopFrame = Frame(appRoot, borderwidth=1, relief=RAISED)
        
        self.centerCanvas = Canvas(appRoot)

        appRoot.columnconfigure(0, minsize=200)
        appRoot.columnconfigure(1, weight=1, minsize=300)
        appRoot.columnconfigure(2, minsize=200)
        appRoot.rowconfigure(0, minsize=50)
        appRoot.rowconfigure(1, minsize=100)
        appRoot.rowconfigure(2, weight=1, minsize=300)
        appRoot.rowconfigure(3, minsize=20)

        self.toolBar.grid(row=0, column=0, columnspan=3, sticky='WENS') # toolBar - cała góra
        self.leftFrame.grid(row=1, column=0, rowspan = 2, sticky='WENS') # lewa strona - 2 wiersze
        self.centerTopFrame.grid(row=1, column=1, sticky='WENS') # top center - ustawienia rozmiarów - na środku, na górze
        self.centerCanvas.grid(row=2, column=1, sticky='WENS') # canvas - na srodku, na dole, rozciągliwe
        self.rightFrame.grid(row=1, column=2, rowspan = 2, sticky='WENS') # prawa strona - 2 wiersze
        self.statusBar.grid(row=3, column=0, columnspan=3, sticky='WENS') # statusBar - cały na dole


        self.katalog = Tix.DirTree(self.leftFrame, options='separator "/" selectMode "single"' , browsecmd=self.browsed)
      
        
        self.katalog.pack()
        
        
    def browsed(self, files):
        print files
    



root = Tix.Tk()
root.title('doobMini')
app = doobMini(root)
root.mainloop()
